<?php
include "../utils/_connection.php";
$var = conectar();
session_start();

$id = $_SESSION['id'];

$sql = "SELECT * FROM authors WHERE id_author='$id'";
$res = mysql_query($sql);
$obj = mysql_fetch_object($res);

?>

<!-- Datos que envia el formulario
name
center
degree
bios
email
pass
-->

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="description" content="">
	<meta name="author" content="">
	<title>Consola: Informacion</title>

	<!-- Le styles -->
	<script type="text/javascript" src="../js/tinymce/tinymce.min.js"></script>
	<script type="text/javascript">
		tinymce.init({
			mode : "specific_textareas",
			editor_selector : "mceEditor",
			plugins: "table, code, image, jbimages",
			content_css: "css/content.css",
			invalid_elements: "span",
    //encoding: "xml",
    apply_source_formatting : true,
    relative_urls: 'false'
});
	</script>

	<link href="../css/bootstrap.css" rel="stylesheet">
	<style type="text/css">
		body {
			padding-top: 60px;
			padding-bottom: 40px;
		}
		.sidebar-nav {
			padding: 9px 0;
		}

		@media (max-width: 980px) {
			/* Enable use of floated navbar text */
			.navbar-text.pull-right {
				float: none;
				padding-left: 5px;
				padding-right: 5px;
			}
		}
	</style>

</head>

<body>

	<?php
	include 'include/header.php';
	?>

	<div class="container">

		<?php 
		include 'include/side.php';
		?>	

		<div class="col-sm-9">
			<div class="hero-unit">
				<form method="post" id="Form" action="info_update.php" >

					<div class="form-group">
						<div class="col-lg-10">
							<div class="page-header">
								<h3>Nombre del Autor</h3>
							</div>
							<div class="col-lg-12"> 
								<input type="text" class="form-control" name="name" id="name" placeholder=<?php echo "'".$obj->name."'";?>>
							</div>
						</div>
					</div>

					<!--Un solo Bloque -->
					<div class="form-group">
						<div class="col-lg-5"> 
							<div class="page-header">
								<h3>Centro de Trabajo</h3>
							</div>
							<div class="col-lg-12">
								<input type="text" class="form-control" name="center" id="center" placeholder=<?php echo "'".$obj->center."'";?>>
							</div>
						</div>
						<div class="col-lg-5">
							<div class="page-header">
								<h3>Grado de Estudios</h3>
							</div>
							<div class="col-lg-12">
								<input type="text" class="form-control" name="degree" id="degree" placeholder=<?php echo "'".$obj->degree."'";?>>
							</div>
						</div>
					</div>

				<div class="form-group">
					<div class="col-lg-10">
						<div class="page-header">
							<h3>Biografia</h3>
						</div>
						<div class="col-lg-12">
							<textarea class="form-control" name="bios" id="bios" rows="5"><?php echo $obj->bios;?></textarea>
						</div>
					</div>
				</div>
					
					<!--Un solo Bloque -->
					<div class="form-group">
						<div class="col-lg-5"> 
							<div class="page-header">
								<h3>E-mail</h3>
							</div>
							<div class="col-lg-12">
								<input type="text" class="form-control" name="email" id="email" placeholder=<?php echo "'".$obj->email."'";?>>
							</div>
						</div>
						<div class="col-lg-5">
							<div class="page-header">
								<h3>Contraseña</h3>
							</div>
							<div class="col-lg-12">
								<input type="password" class="form-control" name="pass" id="pass">
							</div>
						</div>
					</div>

					<div class="form-group">
						<div class="col-lg-offset-4 col-lg-3">
							<br><br>
							<button class="btn btn-success"> Enviar </button>
						</div>
					</div>

				</form>
			</div>
		</div>

	</div><!--/row-->

	<!--Le Separator -->
	<hr>

	<?php
	include 'include/footer.php';
	?>	

</div><!--/.fluid-container-->

<?php
include 'include/scripts.php';
?>

</body>
</html>
